<?php

namespace App\Admin\Http\Middleware;

abstract class Middleware
{
    /**
     * 当前登录用户
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \App\Admin\Eloquent\User|null
     */
    protected function getLoginUser($request)
    {
        $sessionKey = sha1(config('session.admin_login_user'));

        return $request->session()->get($sessionKey);
    }
}